<head><link rel="stylesheet" href="default.css" type="text/css" /></head><body><pre><span class = Comment>{-# LANGUAGE CPP</span><span class = Comment>           , NoImplicitPrelude</span><span class = Comment>           , BangPatterns</span><span class = Comment>           , ExplicitForAll</span><span class = Comment>           , MagicHash</span><span class = Comment>           , UnboxedTuples</span><span class = Comment>           , ExistentialQuantification</span><span class = Comment>           , Rank2Types</span><span class = Comment>  #-}</span><br><span class = Comment>-- -fno-warn-orphans is needed for things like:</span><span class = Comment>-- Orphan rule: "x# -# x#" ALWAYS forall x# :: Int# -# x# x# = 0</span><span class = Comment>{-# OPTIONS_GHC -fno-warn-orphans #-}</span><br><span class = Comment>{-# OPTIONS_HADDOCK hide #-}</span><br><br><span class = Comment>-----------------------------------------------------------------------------</span><span class = Comment>-- |</span><span class = Comment>-- Module      :  GHC.Base</span><span class = Comment>-- Copyright   :  (c) The University of Glasgow, 1992-2002</span><span class = Comment>-- License     :  see libraries/base/LICENSE</span><span class = Comment>-- </span><span class = Comment>-- Maintainer  :  cvs-ghc@haskell.org</span><span class = Comment>-- Stability   :  internal</span><span class = Comment>-- Portability :  non-portable (GHC extensions)</span><span class = Comment>--</span><span class = Comment>-- Basic data types and classes.</span><span class = Comment>-- </span><span class = Comment>-----------------------------------------------------------------------------</span><br><span class = Undefined>#</span><span class = Identifier>include</span>&nbsp;<span class = StringConst>"MachDeps.h"</span><br><br><span class = Comment>-- #hide</span><span class = Keyword>module</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>Base</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>(</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Keyword>module</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>Base</span><span class = Undefined>,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Keyword>module</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>Classes</span><span class = Undefined>,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Keyword>module</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>CString</span><span class = Undefined>,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Keyword>module</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>Ordering</span><span class = Undefined>,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Keyword>module</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>Types</span><span class = Undefined>,</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Keyword>module</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>Prim</span><span class = Undefined>,</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- Re-export GHC.Prim and GHC.Err, to avoid lots</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Keyword>module</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>Err</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- of people having to import it explicitly</span>&nbsp;&nbsp;<span class = Undefined>)</span>&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Keyword>where</span><br><br><span class = Keyword>import</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>Types</span><br><span class = Keyword>import</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>Classes</span><br><span class = Keyword>import</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>CString</span><br><span class = Keyword>import</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>Ordering</span><br><span class = Keyword>import</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>Prim</span><br><span class = Keyword>import</span>&nbsp;<span class = Comment>{-# SOURCE #-}</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>Show</span><br><span class = Keyword>import</span>&nbsp;<span class = Comment>{-# SOURCE #-}</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>Err</span><br><span class = Keyword>import</span>&nbsp;<span class = Comment>{-# SOURCE #-}</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>IO</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>failIO</span><span class = Undefined>)</span><br><br><span class = Comment>-- These two are not strictly speaking required by this module, but they are</span><span class = Comment>-- implicit dependencies whenever () or tuples are mentioned, so adding them</span><span class = Comment>-- as imports here helps to get the dependencies right in the new build system.</span><span class = Keyword>import</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>Tuple</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>)</span><br><span class = Keyword>import</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>Unit</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>)</span><br><br><span class = Keyword>infixr</span>&nbsp;<span class = Undefined>9</span>&nbsp;&nbsp;<span class = Undefined>.</span><br><span class = Keyword>infixr</span>&nbsp;<span class = Undefined>5</span>&nbsp;&nbsp;<span class = Undefined>+</span><span class = Undefined>+</span><br><span class = Keyword>infixl</span>&nbsp;<span class = Undefined>4</span>&nbsp;&nbsp;<span class = Undefined>&lt;</span><span class = Undefined>$</span><br><span class = Keyword>infixl</span>&nbsp;<span class = Undefined>1</span>&nbsp;&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>&gt;</span><span class = Undefined>,</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>&gt;</span><span class = Undefined>=</span><br><span class = Keyword>infixr</span>&nbsp;<span class = Undefined>0</span>&nbsp;&nbsp;<span class = Undefined>$</span><br><br><span class = Keyword>default</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- Double isn't available yet</span><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>subsection</span><span class = Undefined>{</span><span class = TypeIdentifier>DEBUGGING</span>&nbsp;<span class = TypeIdentifier>STUFF</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>for</span>&nbsp;<span class = Identifier>use</span>&nbsp;<span class = Identifier>when</span>&nbsp;<span class = Identifier>compiling</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>Base</span>&nbsp;<span class = Identifier>itself</span>&nbsp;<span class = Identifier>doesn't</span>&nbsp;<span class = Identifier>work</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>begin</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span><br><span class = Comment>{-</span><span class = Comment>data  Bool  =  False | True</span><span class = Comment>data Ordering = LT | EQ | GT </span><span class = Comment>data Char = C# Char#</span><span class = Comment>type  String = [Char]</span><span class = Comment>data Int = I# Int#</span><span class = Comment>data  ()  =  ()</span><span class = Comment>data [] a = MkNil</span><span class = Comment></span><span class = Comment>not True = False</span><span class = Comment>(&amp;&amp;) True True = True</span><span class = Comment>otherwise = True</span><span class = Comment></span><span class = Comment>build = error "urk"</span><span class = Comment>foldr = error "urk"</span><span class = Comment>-}</span><br><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>subsection</span><span class = Undefined>{</span><span class = TypeIdentifier>Monadic</span>&nbsp;<span class = Identifier>classes</span>&nbsp;<span class = Undefined>@</span><span class = TypeIdentifier>Functor</span><span class = Undefined>@</span><span class = Undefined>,</span>&nbsp;<span class = Undefined>@</span><span class = TypeIdentifier>Monad</span><span class = Undefined>@</span>&nbsp;<span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>begin</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span><br><span class = Comment>{- | The 'Functor' class is used for types that can be mapped over.</span><span class = Comment>Instances of 'Functor' should satisfy the following laws:</span><span class = Comment></span><span class = Comment>&gt; fmap id  ==  id</span><span class = Comment>&gt; fmap (f . g)  ==  fmap f . fmap g</span><span class = Comment></span><span class = Comment>The instances of 'Functor' for lists, 'Data.Maybe.Maybe' and 'System.IO.IO'</span><span class = Comment>satisfy these laws.</span><span class = Comment>-}</span><br><br><span class = Keyword>class</span>&nbsp;&nbsp;<span class = TypeIdentifier>Functor</span>&nbsp;<span class = Identifier>f</span>&nbsp;&nbsp;<span class = Keyword>where</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Identifier>fmap</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>f</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>f</span>&nbsp;<span class = Identifier>b</span><br><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- | Replace all locations in the input with the same value.</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- The default definition is @'fmap' . 'const'@, but this may be</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- overridden with a more efficient version.</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>(</span><span class = Undefined>&lt;</span><span class = Undefined>$</span><span class = Undefined>)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>f</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>f</span>&nbsp;<span class = Identifier>a</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>(</span><span class = Undefined>&lt;</span><span class = Undefined>$</span><span class = Undefined>)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;&nbsp;<span class = Identifier>fmap</span>&nbsp;<span class = Undefined>.</span>&nbsp;<span class = Identifier>const</span><br><br><span class = Comment>{- | The 'Monad' class defines the basic operations over a /monad/,</span><span class = Comment>a concept from a branch of mathematics known as /category theory/.</span><span class = Comment>From the perspective of a Haskell programmer, however, it is best to</span><span class = Comment>think of a monad as an /abstract datatype/ of actions.</span><span class = Comment>Haskell's @do@ expressions provide a convenient syntax for writing</span><span class = Comment>monadic expressions.</span><span class = Comment></span><span class = Comment>Minimal complete definition: '&gt;&gt;=' and 'return'.</span><span class = Comment></span><span class = Comment>Instances of 'Monad' should satisfy the following laws:</span><span class = Comment></span><span class = Comment>&gt; return a &gt;&gt;= k  ==  k a</span><span class = Comment>&gt; m &gt;&gt;= return  ==  m</span><span class = Comment>&gt; m &gt;&gt;= (\x -&gt; k x &gt;&gt;= h)  ==  (m &gt;&gt;= k) &gt;&gt;= h</span><span class = Comment></span><span class = Comment>Instances of both 'Monad' and 'Functor' should additionally satisfy the law:</span><span class = Comment></span><span class = Comment>&gt; fmap f xs  ==  xs &gt;&gt;= return . f</span><span class = Comment></span><span class = Comment>The instances of 'Monad' for lists, 'Data.Maybe.Maybe' and 'System.IO.IO'</span><span class = Comment>defined in the "Prelude" satisfy these laws.</span><span class = Comment>-}</span><br><br><span class = Keyword>class</span>&nbsp;&nbsp;<span class = TypeIdentifier>Monad</span>&nbsp;<span class = Identifier>m</span>&nbsp;&nbsp;<span class = Keyword>where</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- | Sequentially compose two actions, passing any value produced</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- by the first as an argument to the second.</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>(</span><span class = Undefined>&gt;</span><span class = Undefined>&gt;</span><span class = Undefined>=</span><span class = Undefined>)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Keyword>forall</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Identifier>b</span><span class = Undefined>.</span>&nbsp;<span class = Identifier>m</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>m</span>&nbsp;<span class = Identifier>b</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>m</span>&nbsp;<span class = Identifier>b</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- | Sequentially compose two actions, discarding any value produced</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- by the first, like sequencing operators (such as the semicolon)</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- in imperative languages.</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>(</span><span class = Undefined>&gt;</span><span class = Undefined>&gt;</span><span class = Undefined>)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Keyword>forall</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Identifier>b</span><span class = Undefined>.</span>&nbsp;<span class = Identifier>m</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>m</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>m</span>&nbsp;<span class = Identifier>b</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- Explicit for-alls so that we know what order to</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- give type arguments when desugaring</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- | Inject a value into the monadic type.</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Identifier>return</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>m</span>&nbsp;<span class = Identifier>a</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- | Fail with a message.  This operation is not part of the</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- mathematical definition of a monad, but is invoked on pattern-match</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- failure in a @do@ expression.</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Identifier>fail</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>String</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>m</span>&nbsp;<span class = Identifier>a</span><br><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>{-# INLINE (&gt;&gt;) #-}</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Identifier>m</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>k</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>m</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>&gt;</span><span class = Undefined>=</span>&nbsp;<span class = Undefined>\</span><span class = Undefined>_</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>k</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Identifier>fail</span>&nbsp;<span class = Identifier>s</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>error</span>&nbsp;<span class = Identifier>s</span><br><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>subsection</span><span class = Undefined>{</span><span class = TypeIdentifier>The</span>&nbsp;<span class = Identifier>list</span>&nbsp;<span class = Keyword>type</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>begin</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span><br><span class = Keyword>instance</span>&nbsp;<span class = TypeIdentifier>Functor</span>&nbsp;<span class = Undefined>[</span><span class = Undefined>]</span>&nbsp;<span class = Keyword>where</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Identifier>fmap</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>map</span><br><br><span class = Keyword>instance</span>&nbsp;&nbsp;<span class = TypeIdentifier>Monad</span>&nbsp;<span class = Undefined>[</span><span class = Undefined>]</span>&nbsp;&nbsp;<span class = Keyword>where</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Identifier>m</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>&gt;</span><span class = Undefined>=</span>&nbsp;<span class = Identifier>k</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>foldr</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>(</span><span class = Undefined>+</span><span class = Undefined>+</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>.</span>&nbsp;<span class = Identifier>k</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>[</span><span class = Undefined>]</span>&nbsp;<span class = Identifier>m</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Identifier>m</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>k</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>foldr</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>(</span><span class = Undefined>+</span><span class = Undefined>+</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>.</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>\</span>&nbsp;<span class = Undefined>_</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>k</span><span class = Undefined>)</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>[</span><span class = Undefined>]</span>&nbsp;<span class = Identifier>m</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Identifier>return</span>&nbsp;<span class = Identifier>x</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Undefined>[</span><span class = Identifier>x</span><span class = Undefined>]</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Identifier>fail</span>&nbsp;<span class = Undefined>_</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Undefined>[</span><span class = Undefined>]</span><br><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = TypeIdentifier>A</span>&nbsp;<span class = Identifier>few</span>&nbsp;<span class = Identifier>list</span>&nbsp;<span class = Identifier>functions</span>&nbsp;<span class = Identifier>that</span>&nbsp;<span class = Identifier>appear</span>&nbsp;<span class = Identifier>here</span>&nbsp;<span class = Identifier>because</span>&nbsp;<span class = Identifier>they</span>&nbsp;<span class = Identifier>are</span>&nbsp;<span class = Identifier>used</span>&nbsp;<span class = Identifier>here</span><span class = Undefined>.</span>&nbsp;<span class = TypeIdentifier>The</span>&nbsp;<span class = Identifier>rest</span>&nbsp;<span class = Keyword>of</span>&nbsp;<span class = Identifier>the</span>&nbsp;<span class = Identifier>prelude</span>&nbsp;<span class = Identifier>list</span>&nbsp;<span class = Identifier>functions</span>&nbsp;<span class = Identifier>are</span>&nbsp;<span class = Keyword>in</span>&nbsp;<span class = TypeIdentifier>GHC</span><span class = Undefined>.</span><span class = TypeIdentifier>List</span><span class = Undefined>.</span>&nbsp;<span class = Comment>---------------------------------------------- -- foldr/build/augment ---------------------------------------------- \begin{code}</span><span class = Comment>-- | 'foldr', applied to a binary operator, a starting value (typically</span><span class = Comment>-- the right-identity of the operator), and a list, reduces the list</span><span class = Comment>-- using the binary operator, from right to left:</span><span class = Comment>--</span><span class = Comment>-- &gt; foldr f z [x1, x2, ..., xn] == x1 `f` (x2 `f` ... (xn `f` z)...)</span><br><span class = Identifier>foldr</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Undefined>[</span><span class = Identifier>a</span><span class = Undefined>]</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span><br><span class = Comment>-- foldr _ z []     =  z</span><span class = Comment>-- foldr f z (x:xs) =  f x (foldr f z xs)</span><span class = Comment>{-# INLINE [0] foldr #-}</span><br><span class = Comment>-- Inline only in the final stage, after the foldr/cons rule has had a chance</span><span class = Comment>-- Also note that we inline it when it has *two* parameters, which are the </span><span class = Comment>-- ones we are keen about specialising!</span><span class = Identifier>foldr</span>&nbsp;<span class = Identifier>k</span>&nbsp;<span class = Identifier>z</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>go</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Keyword>where</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Identifier>go</span>&nbsp;<span class = Undefined>[</span><span class = Undefined>]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>z</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Identifier>go</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>y</span><span class = Undefined>:</span><span class = Identifier>ys</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>y</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>k</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>go</span>&nbsp;<span class = Identifier>ys</span><br><br><span class = Comment>-- | A list producer that can be fused with 'foldr'.</span><span class = Comment>-- This function is merely</span><span class = Comment>--</span><span class = Comment>-- &gt;    build g = g (:) []</span><span class = Comment>--</span><span class = Comment>-- but GHC's simplifier will transform an expression of the form</span><span class = Comment>-- @'foldr' k z ('build' g)@, which may arise after inlining, to @g k z@,</span><span class = Comment>-- which avoids producing an intermediate list.</span><br><span class = Identifier>build</span>&nbsp;&nbsp;&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Keyword>forall</span>&nbsp;<span class = Identifier>a</span><span class = Undefined>.</span>&nbsp;<span class = Undefined>(</span><span class = Keyword>forall</span>&nbsp;<span class = Identifier>b</span><span class = Undefined>.</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Undefined>[</span><span class = Identifier>a</span><span class = Undefined>]</span><br><span class = Comment>{-# INLINE [1] build #-}</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- The INLINE is important, even though build is tiny,</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- because it prevents [] getting inlined in the version that</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- appears in the interface file.  If [] *is* inlined, it</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- won't match with [] appearing in rules in an importing module.</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>--</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- The "1" says to inline in phase 1</span><br><span class = Identifier>build</span>&nbsp;<span class = Identifier>g</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>g</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>:</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>[</span><span class = Undefined>]</span><br><br><span class = Comment>-- | A list producer that can be fused with 'foldr'.</span><span class = Comment>-- This function is merely</span><span class = Comment>--</span><span class = Comment>-- &gt;    augment g xs = g (:) xs</span><span class = Comment>--</span><span class = Comment>-- but GHC's simplifier will transform an expression of the form</span><span class = Comment>-- @'foldr' k z ('augment' g xs)@, which may arise after inlining, to</span><span class = Comment>-- @g k ('foldr' k z xs)@, which avoids producing an intermediate list.</span><br><span class = Identifier>augment</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Keyword>forall</span>&nbsp;<span class = Identifier>a</span><span class = Undefined>.</span>&nbsp;<span class = Undefined>(</span><span class = Keyword>forall</span>&nbsp;<span class = Identifier>b</span><span class = Undefined>.</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>a</span><span class = Undefined>-</span><span class = Undefined>&gt;</span><span class = Identifier>b</span><span class = Undefined>-</span><span class = Undefined>&gt;</span><span class = Identifier>b</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Undefined>[</span><span class = Identifier>a</span><span class = Undefined>]</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Undefined>[</span><span class = Identifier>a</span><span class = Undefined>]</span><br><span class = Comment>{-# INLINE [1] augment #-}</span><br><span class = Identifier>augment</span>&nbsp;<span class = Identifier>g</span>&nbsp;<span class = Identifier>xs</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>g</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>:</span><span class = Undefined>)</span>&nbsp;<span class = Identifier>xs</span><br><br><span class = Comment>{-# RULES</span><span class = Comment>"fold/build"    forall k z (g::forall b. (a-&gt;b-&gt;b) -&gt; b -&gt; b) . </span><span class = Comment>                foldr k z (build g) = g k z</span><span class = Comment></span><span class = Comment>"foldr/augment" forall k z xs (g::forall b. (a-&gt;b-&gt;b) -&gt; b -&gt; b) . </span><span class = Comment>                foldr k z (augment g xs) = g k (foldr k z xs)</span><span class = Comment></span><span class = Comment>"foldr/id"                        foldr (:) [] = \x  -&gt; x</span><span class = Comment>"foldr/app"     [1] forall ys. foldr (:) ys = \xs -&gt; xs ++ ys</span><span class = Comment>        -- Only activate this from phase 1, because that's</span><span class = Comment>        -- when we disable the rule that expands (++) into foldr</span><span class = Comment></span><span class = Comment>-- The foldr/cons rule looks nice, but it can give disastrously</span><span class = Comment>-- bloated code when commpiling</span><span class = Comment>--      array (a,b) [(1,2), (2,2), (3,2), ...very long list... ]</span><span class = Comment>-- i.e. when there are very very long literal lists</span><span class = Comment>-- So I've disabled it for now. We could have special cases</span><span class = Comment>-- for short lists, I suppose.</span><span class = Comment>-- "foldr/cons" forall k z x xs. foldr k z (x:xs) = k x (foldr k z xs)</span><span class = Comment></span><span class = Comment>"foldr/single"  forall k z x. foldr k z [x] = k x z</span><span class = Comment>"foldr/nil"     forall k z.   foldr k z []  = z </span><span class = Comment></span><span class = Comment>"augment/build" forall (g::forall b. (a-&gt;b-&gt;b) -&gt; b -&gt; b)</span><span class = Comment>                       (h::forall b. (a-&gt;b-&gt;b) -&gt; b -&gt; b) .</span><span class = Comment>                       augment g (build h) = build (\c n -&gt; g c (h c n))</span><span class = Comment>"augment/nil"   forall (g::forall b. (a-&gt;b-&gt;b) -&gt; b -&gt; b) .</span><span class = Comment>                        augment g [] = build g</span><span class = Comment> #-}</span><br><br><span class = Comment>-- This rule is true, but not (I think) useful:</span><span class = Comment>--      augment g (augment h t) = augment (\cn -&gt; g c (h c n)) t</span><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = Comment>---------------------------------------------- -- map ---------------------------------------------- \begin{code}</span><span class = Comment>-- | 'map' @f xs@ is the list obtained by applying @f@ to each element</span><span class = Comment>-- of @xs@, i.e.,</span><span class = Comment>--</span><span class = Comment>-- &gt; map f [x1, x2, ..., xn] == [f x1, f x2, ..., f xn]</span><span class = Comment>-- &gt; map f [x1, x2, ...] == [f x1, f x2, ...]</span><br><span class = Identifier>map</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Undefined>[</span><span class = Identifier>a</span><span class = Undefined>]</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Undefined>[</span><span class = Identifier>b</span><span class = Undefined>]</span><br><span class = Identifier>map</span>&nbsp;<span class = Undefined>_</span>&nbsp;<span class = Undefined>[</span><span class = Undefined>]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Undefined>[</span><span class = Undefined>]</span><br><span class = Identifier>map</span>&nbsp;<span class = Identifier>f</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>x</span><span class = Undefined>:</span><span class = Identifier>xs</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>f</span>&nbsp;<span class = Identifier>x</span>&nbsp;<span class = Undefined>:</span>&nbsp;<span class = Identifier>map</span>&nbsp;<span class = Identifier>f</span>&nbsp;<span class = Identifier>xs</span><br><br><span class = Comment>-- Note eta expanded</span><span class = Identifier>mapFB</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;&nbsp;<span class = Undefined>(</span><span class = Identifier>elt</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>lst</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>lst</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>elt</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>lst</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>lst</span><br><span class = Comment>{-# INLINE [0] mapFB #-}</span><br><span class = Identifier>mapFB</span>&nbsp;<span class = Identifier>c</span>&nbsp;<span class = Identifier>f</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>x</span>&nbsp;<span class = Identifier>ys</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>c</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>f</span>&nbsp;<span class = Identifier>x</span><span class = Undefined>)</span>&nbsp;<span class = Identifier>ys</span><br><br><span class = Comment>-- The rules for map work like this.</span><span class = Comment>-- </span><span class = Comment>-- Up to (but not including) phase 1, we use the "map" rule to</span><span class = Comment>-- rewrite all saturated applications of map with its build/fold </span><span class = Comment>-- form, hoping for fusion to happen.</span><span class = Comment>-- In phase 1 and 0, we switch off that rule, inline build, and</span><span class = Comment>-- switch on the "mapList" rule, which rewrites the foldr/mapFB</span><span class = Comment>-- thing back into plain map.  </span><span class = Comment>--</span><span class = Comment>-- It's important that these two rules aren't both active at once </span><span class = Comment>-- (along with build's unfolding) else we'd get an infinite loop </span><span class = Comment>-- in the rules.  Hence the activation control below.</span><span class = Comment>--</span><span class = Comment>-- The "mapFB" rule optimises compositions of map.</span><span class = Comment>--</span><span class = Comment>-- This same pattern is followed by many other functions: </span><span class = Comment>-- e.g. append, filter, iterate, repeat, etc.</span><br><span class = Comment>{-# RULES</span><span class = Comment>"map"       [~1] forall f xs.   map f xs                = build (\c n -&gt; foldr (mapFB c f) n xs)</span><span class = Comment>"mapList"   [1]  forall f.      foldr (mapFB (:) f) []  = map f</span><span class = Comment>"mapFB"     forall c f g.       mapFB (mapFB c f) g     = mapFB c (f.g) </span><span class = Comment>  #-}</span><br><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = Comment>---------------------------------------------- -- append ---------------------------------------------- \begin{code}</span><span class = Comment>-- | Append two lists, i.e.,</span><span class = Comment>--</span><span class = Comment>-- &gt; [x1, ..., xm] ++ [y1, ..., yn] == [x1, ..., xm, y1, ..., yn]</span><span class = Comment>-- &gt; [x1, ..., xm] ++ [y1, ...] == [x1, ..., xm, y1, ...]</span><span class = Comment>--</span><span class = Comment>-- If the first list is not finite, the result is the first list.</span><br><span class = Undefined>(</span><span class = Undefined>+</span><span class = Undefined>+</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Undefined>[</span><span class = Identifier>a</span><span class = Undefined>]</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Undefined>[</span><span class = Identifier>a</span><span class = Undefined>]</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Undefined>[</span><span class = Identifier>a</span><span class = Undefined>]</span><br><span class = Undefined>(</span><span class = Undefined>+</span><span class = Undefined>+</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>[</span><span class = Undefined>]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Identifier>ys</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>ys</span><br><span class = Undefined>(</span><span class = Undefined>+</span><span class = Undefined>+</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>x</span><span class = Undefined>:</span><span class = Identifier>xs</span><span class = Undefined>)</span>&nbsp;<span class = Identifier>ys</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>x</span>&nbsp;<span class = Undefined>:</span>&nbsp;<span class = Identifier>xs</span>&nbsp;<span class = Undefined>+</span><span class = Undefined>+</span>&nbsp;<span class = Identifier>ys</span><br><br><span class = Comment>{-# RULES</span><span class = Comment>"++"    [~1] forall xs ys. xs ++ ys = augment (\c n -&gt; foldr c n xs) ys</span><span class = Comment>  #-}</span><br><br><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>subsection</span><span class = Undefined>{</span><span class = TypeIdentifier>Type</span>&nbsp;<span class = Undefined>@</span><span class = TypeIdentifier>Bool</span><span class = Undefined>@</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>begin</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span><br><span class = Comment>-- |'otherwise' is defined as the value 'True'.  It helps to make</span><span class = Comment>-- guards more readable.  eg.</span><span class = Comment>--</span><span class = Comment>-- &gt;  f x | x &lt; 0     = ...</span><span class = Comment>-- &gt;      | otherwise = ...</span><span class = Identifier>otherwise</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>Bool</span><br><span class = Identifier>otherwise</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;&nbsp;<span class = TypeIdentifier>True</span><br><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>subsection</span><span class = Undefined>{</span><span class = TypeIdentifier>Type</span>&nbsp;<span class = Undefined>@</span><span class = TypeIdentifier>Char</span><span class = Undefined>@</span>&nbsp;<span class = Identifier>and</span>&nbsp;<span class = Undefined>@</span><span class = TypeIdentifier>String</span><span class = Undefined>@</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>begin</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span><br><span class = Comment>-- | A 'String' is a list of characters.  String constants in Haskell are values</span><span class = Comment>-- of type 'String'.</span><span class = Comment>--</span><span class = Keyword>type</span>&nbsp;<span class = TypeIdentifier>String</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Undefined>[</span><span class = TypeIdentifier>Char</span><span class = Undefined>]</span><br><br><span class = Comment>{-# RULES</span><span class = Comment>"x# `eqChar#` x#" forall x#. x# `eqChar#` x# = True</span><span class = Comment>"x# `neChar#` x#" forall x#. x# `neChar#` x# = False</span><span class = Comment>"x# `gtChar#` x#" forall x#. x# `gtChar#` x# = False</span><span class = Comment>"x# `geChar#` x#" forall x#. x# `geChar#` x# = True</span><span class = Comment>"x# `leChar#` x#" forall x#. x# `leChar#` x# = True</span><span class = Comment>"x# `ltChar#` x#" forall x#. x# `ltChar#` x# = False</span><span class = Comment>  #-}</span><br><br><span class = Comment>-- | The 'Prelude.toEnum' method restricted to the type 'Data.Char.Char'.</span><span class = Identifier>chr</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>Int</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Char</span><br><span class = Identifier>chr</span>&nbsp;<span class = Identifier>i</span><span class = Undefined>@</span><span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>i</span><span class = Undefined>#</span><span class = Undefined>)</span><br>&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Identifier>int2Word</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>i</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>leWord</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>int2Word</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Identifier>x10FFFF</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>C</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>chr</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>i</span><span class = Undefined>#</span><span class = Undefined>)</span><br>&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Identifier>otherwise</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>error</span>&nbsp;<span class = Undefined>(</span><span class = StringConst>"Prelude.chr: bad argument: "</span>&nbsp;<span class = Undefined>+</span><span class = Undefined>+</span>&nbsp;<span class = Identifier>showSignedInt</span>&nbsp;<span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>9</span><span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Identifier>i</span>&nbsp;<span class = StringConst>""</span><span class = Undefined>)</span><br><br><span class = Identifier>unsafeChr</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>Int</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Char</span><br><span class = Identifier>unsafeChr</span>&nbsp;<span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>i</span><span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>C</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>chr</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>i</span><span class = Undefined>#</span><span class = Undefined>)</span><br><br><span class = Comment>-- | The 'Prelude.fromEnum' method restricted to the type 'Data.Char.Char'.</span><span class = Identifier>ord</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>Char</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span><br><span class = Identifier>ord</span>&nbsp;<span class = Undefined>(</span><span class = TypeIdentifier>C</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>c</span><span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>ord</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>c</span><span class = Undefined>#</span><span class = Undefined>)</span><br><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = TypeIdentifier>String</span>&nbsp;<span class = Identifier>equality</span>&nbsp;<span class = Identifier>is</span>&nbsp;<span class = Identifier>used</span>&nbsp;<span class = Identifier>when</span>&nbsp;<span class = Identifier>desugaring</span>&nbsp;<span class = Identifier>pattern</span><span class = Undefined>-</span><span class = Identifier>matches</span>&nbsp;<span class = Identifier>against</span>&nbsp;<span class = Identifier>strings</span><span class = Undefined>.</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>begin</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span><br><span class = Identifier>eqString</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>String</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>String</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Bool</span><br><span class = Identifier>eqString</span>&nbsp;<span class = Undefined>[</span><span class = Undefined>]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>[</span><span class = Undefined>]</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>True</span><br><span class = Identifier>eqString</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>c1</span><span class = Undefined>:</span><span class = Identifier>cs1</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>c2</span><span class = Undefined>:</span><span class = Identifier>cs2</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>c1</span>&nbsp;<span class = Undefined>=</span><span class = Undefined>=</span>&nbsp;<span class = Identifier>c2</span>&nbsp;<span class = Undefined>&amp;</span><span class = Undefined>&amp;</span>&nbsp;<span class = Identifier>cs1</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>eqString</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>cs2</span><br><span class = Identifier>eqString</span>&nbsp;<span class = Undefined>_</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>_</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>False</span><br><br><span class = Comment>{-# RULES "eqString" (==) = eqString #-}</span><br><span class = Comment>-- eqString also has a BuiltInRule in PrelRules.lhs:</span><span class = Comment>--      eqString (unpackCString# (Lit s1)) (unpackCString# (Lit s2) = s1==s2</span><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>subsection</span><span class = Undefined>{</span><span class = TypeIdentifier>Type</span>&nbsp;<span class = Undefined>@</span><span class = TypeIdentifier>Int</span><span class = Undefined>@</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>begin</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span><br><span class = Identifier>zeroInt</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>oneInt</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>twoInt</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>maxInt</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>minInt</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>Int</span><br><span class = Identifier>zeroInt</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span><br><span class = Identifier>oneInt</span>&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>1</span><span class = Undefined>#</span><br><span class = Identifier>twoInt</span>&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>2</span><span class = Undefined>#</span><br><br><span class = Comment>{- Seems clumsy. Should perhaps put minInt and MaxInt directly into MachDeps.h -}</span><br><span class = Undefined>#</span><span class = Keyword>if</span>&nbsp;<span class = TypeIdentifier>WORD</span><span class = Undefined>_</span><span class = TypeIdentifier>SIZE</span><span class = Undefined>_</span><span class = TypeIdentifier>IN</span><span class = Undefined>_</span><span class = TypeIdentifier>BITS</span>&nbsp;<span class = Undefined>=</span><span class = Undefined>=</span>&nbsp;<span class = Undefined>3</span><span class = Undefined>1</span><br><span class = Identifier>minInt</span>&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>-</span><span class = Undefined>0</span><span class = Identifier>x40000000</span><span class = Undefined>#</span><span class = Undefined>)</span><br><span class = Identifier>maxInt</span>&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Identifier>x3FFFFFFF</span><span class = Undefined>#</span><br><span class = Undefined>#</span><span class = Identifier>elif</span>&nbsp;<span class = TypeIdentifier>WORD</span><span class = Undefined>_</span><span class = TypeIdentifier>SIZE</span><span class = Undefined>_</span><span class = TypeIdentifier>IN</span><span class = Undefined>_</span><span class = TypeIdentifier>BITS</span>&nbsp;<span class = Undefined>=</span><span class = Undefined>=</span>&nbsp;<span class = Undefined>3</span><span class = Undefined>2</span><br><span class = Identifier>minInt</span>&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>-</span><span class = Undefined>0</span><span class = Identifier>x80000000</span><span class = Undefined>#</span><span class = Undefined>)</span><br><span class = Identifier>maxInt</span>&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Identifier>x7FFFFFFF</span><span class = Undefined>#</span><br><span class = Undefined>#</span><span class = Keyword>else</span>&nbsp;<br><span class = Identifier>minInt</span>&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>-</span><span class = Undefined>0</span><span class = Identifier>x8000000000000000</span><span class = Undefined>#</span><span class = Undefined>)</span><br><span class = Identifier>maxInt</span>&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Identifier>x7FFFFFFFFFFFFFFF</span><span class = Undefined>#</span><br><span class = Undefined>#</span><span class = Identifier>endif</span><br><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>subsection</span><span class = Undefined>{</span><span class = TypeIdentifier>The</span>&nbsp;<span class = Identifier>function</span>&nbsp;<span class = Keyword>type</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>begin</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span><br><span class = Comment>-- | Identity function.</span><span class = Identifier>id</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span><br><span class = Identifier>id</span>&nbsp;<span class = Identifier>x</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;&nbsp;<span class = Identifier>x</span><br><br><span class = Comment>-- | The call '(lazy e)' means the same as 'e', but 'lazy' has a </span><span class = Comment>-- magical strictness property: it is lazy in its first argument, </span><span class = Comment>-- even though its semantics is strict.</span><span class = Identifier>lazy</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span><br><span class = Identifier>lazy</span>&nbsp;<span class = Identifier>x</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>x</span><br><span class = Comment>-- Implementation note: its strictness and unfolding are over-ridden</span><span class = Comment>-- by the definition in MkId.lhs; in both cases to nothing at all.</span><span class = Comment>-- That way, 'lazy' does not get inlined, and the strictness analyser</span><span class = Comment>-- sees it as lazy.  Then the worker/wrapper phase inlines it.</span><span class = Comment>-- Result: happiness</span><br><span class = Comment>-- Assertion function.  This simply ignores its boolean argument.</span><span class = Comment>-- The compiler may rewrite it to @('assertError' line)@.</span><br><span class = Comment>-- | If the first argument evaluates to 'True', then the result is the</span><span class = Comment>-- second argument.  Otherwise an 'AssertionFailed' exception is raised,</span><span class = Comment>-- containing a 'String' with the source file and line number of the</span><span class = Comment>-- call to 'assert'.</span><span class = Comment>--</span><span class = Comment>-- Assertions can normally be turned on or off with a compiler flag</span><span class = Comment>-- (for GHC, assertions are normally on unless optimisation is turned on </span><span class = Comment>-- with @-O@ or the @-fignore-asserts@</span><span class = Comment>-- option is given).  When assertions are turned off, the first</span><span class = Comment>-- argument to 'assert' is ignored, and the second argument is</span><span class = Comment>-- returned as the result.</span><br><span class = Comment>--      SLPJ: in 5.04 etc 'assert' is in GHC.Prim,</span><span class = Comment>--      but from Template Haskell onwards it's simply</span><span class = Comment>--      defined here in Base.lhs</span><span class = Identifier>assert</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>Bool</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span><br><span class = Identifier>assert</span>&nbsp;<span class = Undefined>_</span><span class = Identifier>pred</span>&nbsp;<span class = Identifier>r</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>r</span><br><br><span class = Identifier>breakpoint</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span><br><span class = Identifier>breakpoint</span>&nbsp;<span class = Identifier>r</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>r</span><br><br><span class = Identifier>breakpointCond</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>Bool</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span><br><span class = Identifier>breakpointCond</span>&nbsp;<span class = Undefined>_</span>&nbsp;<span class = Identifier>r</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>r</span><br><br><span class = Keyword>data</span>&nbsp;<span class = TypeIdentifier>Opaque</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Keyword>forall</span>&nbsp;<span class = Identifier>a</span><span class = Undefined>.</span>&nbsp;<span class = TypeIdentifier>O</span>&nbsp;<span class = Identifier>a</span><br><br><span class = Comment>-- | Constant function.</span><span class = Identifier>const</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span><br><span class = Identifier>const</span>&nbsp;<span class = Identifier>x</span>&nbsp;<span class = Undefined>_</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;&nbsp;<span class = Identifier>x</span><br><br><span class = Comment>-- | Function composition.</span><span class = Comment>{-# INLINE (.) #-}</span><br><span class = Comment>-- Make sure it has TWO args only on the left, so that it inlines</span><span class = Comment>-- when applied to two functions, even if there is no final argument</span><span class = Undefined>(</span><span class = Undefined>.</span><span class = Undefined>)</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>b</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>c</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>c</span><br><span class = Undefined>(</span><span class = Undefined>.</span><span class = Undefined>)</span>&nbsp;<span class = Identifier>f</span>&nbsp;<span class = Identifier>g</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>x</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>f</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>g</span>&nbsp;<span class = Identifier>x</span><span class = Undefined>)</span><br><br><span class = Comment>-- | @'flip' f@ takes its (first) two arguments in the reverse order of @f@.</span><span class = Identifier>flip</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>c</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>c</span><br><span class = Identifier>flip</span>&nbsp;<span class = Identifier>f</span>&nbsp;<span class = Identifier>x</span>&nbsp;<span class = Identifier>y</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;&nbsp;<span class = Identifier>f</span>&nbsp;<span class = Identifier>y</span>&nbsp;<span class = Identifier>x</span><br><br><span class = Comment>-- | Application operator.  This operator is redundant, since ordinary</span><span class = Comment>-- application @(f x)@ means the same as @(f '$' x)@. However, '$' has</span><span class = Comment>-- low, right-associative binding precedence, so it sometimes allows</span><span class = Comment>-- parentheses to be omitted; for example:</span><span class = Comment>--</span><span class = Comment>-- &gt;     f $ g $ h x  =  f (g (h x))</span><span class = Comment>--</span><span class = Comment>-- It is also useful in higher-order situations, such as @'map' ('$' 0) xs@,</span><span class = Comment>-- or @'Data.List.zipWith' ('$') fs xs@.</span><span class = Comment>{-# INLINE ($) #-}</span><br><span class = Undefined>(</span><span class = Undefined>$</span><span class = Undefined>)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>b</span><br><span class = Identifier>f</span>&nbsp;<span class = Undefined>$</span>&nbsp;<span class = Identifier>x</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;&nbsp;<span class = Identifier>f</span>&nbsp;<span class = Identifier>x</span><br><br><span class = Comment>-- | @'until' p f@ yields the result of applying @f@ until @p@ holds.</span><span class = Identifier>until</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Bool</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span><br><span class = Identifier>until</span>&nbsp;<span class = Identifier>p</span>&nbsp;<span class = Identifier>f</span>&nbsp;<span class = Identifier>x</span>&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Identifier>p</span>&nbsp;<span class = Identifier>x</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;&nbsp;<span class = Identifier>x</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Identifier>otherwise</span>&nbsp;<span class = Undefined>=</span>&nbsp;&nbsp;<span class = Identifier>until</span>&nbsp;<span class = Identifier>p</span>&nbsp;<span class = Identifier>f</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>f</span>&nbsp;<span class = Identifier>x</span><span class = Undefined>)</span><br><br><span class = Comment>-- | 'asTypeOf' is a type-restricted version of 'const'.  It is usually</span><span class = Comment>-- used as an infix operator, and its typing forces its first argument</span><span class = Comment>-- (which is usually overloaded) to have the same type as the second.</span><span class = Identifier>asTypeOf</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>a</span><br><span class = Identifier>asTypeOf</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;&nbsp;<span class = Identifier>const</span><br><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>subsection</span><span class = Undefined>{</span><span class = Undefined>@</span><span class = TypeIdentifier>Functor</span><span class = Undefined>@</span>&nbsp;<span class = Identifier>and</span>&nbsp;<span class = Undefined>@</span><span class = TypeIdentifier>Monad</span><span class = Undefined>@</span>&nbsp;<span class = Identifier>instances</span>&nbsp;<span class = Identifier>for</span>&nbsp;<span class = Undefined>@</span><span class = TypeIdentifier>IO</span><span class = Undefined>@</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>begin</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span><br><span class = Keyword>instance</span>&nbsp;&nbsp;<span class = TypeIdentifier>Functor</span>&nbsp;<span class = TypeIdentifier>IO</span>&nbsp;<span class = Keyword>where</span><br>&nbsp;&nbsp;&nbsp;<span class = Identifier>fmap</span>&nbsp;<span class = Identifier>f</span>&nbsp;<span class = Identifier>x</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>x</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>&gt;</span><span class = Undefined>=</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>return</span>&nbsp;<span class = Undefined>.</span>&nbsp;<span class = Identifier>f</span><span class = Undefined>)</span><br><br><span class = Keyword>instance</span>&nbsp;&nbsp;<span class = TypeIdentifier>Monad</span>&nbsp;<span class = TypeIdentifier>IO</span>&nbsp;&nbsp;<span class = Keyword>where</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>{-# INLINE return #-}</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>{-# INLINE (&gt;&gt;)   #-}</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>{-# INLINE (&gt;&gt;=)  #-}</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Identifier>m</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>k</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>m</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>&gt;</span><span class = Undefined>=</span>&nbsp;<span class = Undefined>\</span>&nbsp;<span class = Undefined>_</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>k</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Identifier>return</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>returnIO</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>(</span><span class = Undefined>&gt;</span><span class = Undefined>&gt;</span><span class = Undefined>=</span><span class = Undefined>)</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>bindIO</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Identifier>fail</span>&nbsp;<span class = Identifier>s</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>failIO</span>&nbsp;<span class = Identifier>s</span><br><br><span class = Identifier>returnIO</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>IO</span>&nbsp;<span class = Identifier>a</span><br><span class = Identifier>returnIO</span>&nbsp;<span class = Identifier>x</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>IO</span>&nbsp;<span class = Undefined>$</span>&nbsp;<span class = Undefined>\</span>&nbsp;<span class = Identifier>s</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>s</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>x</span>&nbsp;<span class = Undefined>#</span><span class = Undefined>)</span><br><br><span class = Identifier>bindIO</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>IO</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>IO</span>&nbsp;<span class = Identifier>b</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>IO</span>&nbsp;<span class = Identifier>b</span><br><span class = Identifier>bindIO</span>&nbsp;<span class = Undefined>(</span><span class = TypeIdentifier>IO</span>&nbsp;<span class = Identifier>m</span><span class = Undefined>)</span>&nbsp;<span class = Identifier>k</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>IO</span>&nbsp;<span class = Undefined>$</span>&nbsp;<span class = Undefined>\</span>&nbsp;<span class = Identifier>s</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Keyword>case</span>&nbsp;<span class = Identifier>m</span>&nbsp;<span class = Identifier>s</span>&nbsp;<span class = Keyword>of</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>new</span><span class = Undefined>_</span><span class = Identifier>s</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>unIO</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>k</span>&nbsp;<span class = Identifier>a</span><span class = Undefined>)</span>&nbsp;<span class = Identifier>new</span><span class = Undefined>_</span><span class = Identifier>s</span><br><br><span class = Identifier>thenIO</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>IO</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>IO</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>IO</span>&nbsp;<span class = Identifier>b</span><br><span class = Identifier>thenIO</span>&nbsp;<span class = Undefined>(</span><span class = TypeIdentifier>IO</span>&nbsp;<span class = Identifier>m</span><span class = Undefined>)</span>&nbsp;<span class = Identifier>k</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>IO</span>&nbsp;<span class = Undefined>$</span>&nbsp;<span class = Undefined>\</span>&nbsp;<span class = Identifier>s</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Keyword>case</span>&nbsp;<span class = Identifier>m</span>&nbsp;<span class = Identifier>s</span>&nbsp;<span class = Keyword>of</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>new</span><span class = Undefined>_</span><span class = Identifier>s</span><span class = Undefined>,</span>&nbsp;<span class = Undefined>_</span>&nbsp;<span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Identifier>unIO</span>&nbsp;<span class = Identifier>k</span>&nbsp;<span class = Identifier>new</span><span class = Undefined>_</span><span class = Identifier>s</span><br><br><span class = Identifier>unIO</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>IO</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Undefined>(</span><span class = TypeIdentifier>State</span><span class = Undefined>#</span>&nbsp;<span class = TypeIdentifier>RealWorld</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>#</span>&nbsp;<span class = TypeIdentifier>State</span><span class = Undefined>#</span>&nbsp;<span class = TypeIdentifier>RealWorld</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>#</span><span class = Undefined>)</span><span class = Undefined>)</span><br><span class = Identifier>unIO</span>&nbsp;<span class = Undefined>(</span><span class = TypeIdentifier>IO</span>&nbsp;<span class = Identifier>a</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>a</span><br><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>subsection</span><span class = Undefined>{</span><span class = Undefined>@</span><span class = Identifier>getTag</span><span class = Undefined>@</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = TypeIdentifier>Returns</span>&nbsp;<span class = Identifier>the</span>&nbsp;<span class = Undefined>'</span><span class = Identifier>tag'</span>&nbsp;<span class = Keyword>of</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Identifier>constructor</span>&nbsp;<span class = Identifier>application</span><span class = Undefined>;</span>&nbsp;<span class = Identifier>this</span>&nbsp;<span class = Identifier>function</span>&nbsp;<span class = Identifier>is</span>&nbsp;<span class = Identifier>used</span>&nbsp;<span class = Identifier>by</span>&nbsp;<span class = Identifier>the</span>&nbsp;<span class = Keyword>deriving</span>&nbsp;<span class = Identifier>code</span>&nbsp;<span class = Identifier>for</span>&nbsp;<span class = TypeIdentifier>Eq</span><span class = Undefined>,</span>&nbsp;<span class = TypeIdentifier>Ord</span>&nbsp;<span class = Identifier>and</span>&nbsp;<span class = TypeIdentifier>Enum</span><span class = Undefined>.</span>&nbsp;<span class = TypeIdentifier>The</span>&nbsp;<span class = Identifier>primitive</span>&nbsp;<span class = Identifier>dataToTag</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>requires</span>&nbsp;<span class = Identifier>an</span>&nbsp;<span class = Identifier>evaluated</span>&nbsp;<span class = Identifier>constructor</span>&nbsp;<span class = Identifier>application</span>&nbsp;<span class = Keyword>as</span>&nbsp;<span class = Identifier>its</span>&nbsp;<span class = Identifier>argument</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>so</span>&nbsp;<span class = Identifier>we</span>&nbsp;<span class = Identifier>provide</span>&nbsp;<span class = Identifier>getTag</span>&nbsp;<span class = Keyword>as</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Identifier>wrapper</span>&nbsp;<span class = Identifier>that</span>&nbsp;<span class = Identifier>performs</span>&nbsp;<span class = Identifier>the</span>&nbsp;<span class = Identifier>evaluation</span>&nbsp;<span class = Identifier>before</span>&nbsp;<span class = Identifier>calling</span>&nbsp;<span class = Identifier>dataToTag</span><span class = Undefined>#</span><span class = Undefined>.</span>&nbsp;<span class = TypeIdentifier>We</span>&nbsp;<span class = Identifier>could</span>&nbsp;<span class = Identifier>have</span>&nbsp;<span class = Identifier>dataToTag</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>evaluate</span>&nbsp;<span class = Identifier>its</span>&nbsp;<span class = Identifier>argument</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>but</span>&nbsp;<span class = Identifier>we</span>&nbsp;<span class = Identifier>prefer</span>&nbsp;<span class = Identifier>to</span>&nbsp;<span class = Keyword>do</span>&nbsp;<span class = Identifier>it</span>&nbsp;<span class = Identifier>this</span>&nbsp;<span class = Identifier>way</span>&nbsp;<span class = Identifier>because</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>a</span><span class = Undefined>)</span>&nbsp;<span class = Identifier>dataToTag</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>can</span>&nbsp;<span class = Identifier>be</span>&nbsp;<span class = Identifier>an</span>&nbsp;<span class = Identifier>inline</span>&nbsp;<span class = Identifier>primop</span>&nbsp;<span class = Keyword>if</span>&nbsp;<span class = Identifier>it</span>&nbsp;<span class = Identifier>doesn't</span>&nbsp;<span class = Identifier>need</span>&nbsp;<span class = Identifier>to</span>&nbsp;<span class = Keyword>do</span>&nbsp;<span class = Identifier>any</span>&nbsp;<span class = Identifier>evaluation</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>and</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>b</span><span class = Undefined>)</span>&nbsp;<span class = Identifier>we</span>&nbsp;<span class = Identifier>want</span>&nbsp;<span class = Identifier>to</span>&nbsp;<span class = Identifier>expose</span>&nbsp;<span class = Identifier>the</span>&nbsp;<span class = Identifier>evaluation</span>&nbsp;<span class = Identifier>to</span>&nbsp;<span class = Identifier>the</span>&nbsp;<span class = Identifier>simplifier</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>because</span>&nbsp;<span class = Identifier>it</span>&nbsp;<span class = Identifier>might</span>&nbsp;<span class = Identifier>be</span>&nbsp;<span class = Identifier>possible</span>&nbsp;<span class = Identifier>to</span>&nbsp;<span class = Identifier>eliminate</span>&nbsp;<span class = Identifier>the</span>&nbsp;<span class = Identifier>evaluation</span>&nbsp;<span class = Keyword>in</span>&nbsp;<span class = Identifier>the</span>&nbsp;<span class = Keyword>case</span>&nbsp;<span class = Identifier>when</span>&nbsp;<span class = Identifier>the</span>&nbsp;<span class = Identifier>argument</span>&nbsp;<span class = Identifier>is</span>&nbsp;<span class = Identifier>already</span>&nbsp;<span class = Identifier>known</span>&nbsp;<span class = Identifier>to</span>&nbsp;<span class = Identifier>be</span>&nbsp;<span class = Identifier>evaluated</span><span class = Undefined>.</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>begin</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span><br><span class = Comment>{-# INLINE getTag #-}</span><br><span class = Identifier>getTag</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span><br><span class = Identifier>getTag</span>&nbsp;<span class = Identifier>x</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>x</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>seq</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>dataToTag</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>x</span><br><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>subsection</span><span class = Undefined>{</span><span class = TypeIdentifier>Numeric</span>&nbsp;<span class = Identifier>primops</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>*</span>&nbsp;<span class = Undefined>%</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span><span class = Undefined>*</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>begin</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span><br><span class = Identifier>divInt</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span><br><span class = Identifier>x</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>divInt</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>#</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- Be careful NOT to overflow if we do any additional arithmetic</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- on the arguments...  the following  previous version of this</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Comment>-- code has problems with overflow:</span><span class = Comment>--    | (x# &gt;# 0#) &amp;&amp; (y# &lt;# 0#) = ((x# -# y#) -# 1#) `quotInt#` y#</span><span class = Comment>--    | (x# &lt;# 0#) &amp;&amp; (y# &gt;# 0#) = ((x# -# y#) +# 1#) `quotInt#` y#</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>x</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>&amp;</span><span class = Undefined>&amp;</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>y</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>&lt;</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>(</span><span class = Identifier>x</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>1</span><span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>quotInt</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>1</span><span class = Undefined>#</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>x</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>&lt;</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>&amp;</span><span class = Undefined>&amp;</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>y</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>(</span><span class = Identifier>x</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>+</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>1</span><span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>quotInt</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>1</span><span class = Undefined>#</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Identifier>otherwise</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>x</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>quotInt</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>#</span><br><br><span class = Identifier>modInt</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span><br><span class = Identifier>x</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>modInt</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>#</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>x</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>&amp;</span><span class = Undefined>&amp;</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>y</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>&lt;</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>|</span><span class = Undefined>|</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>(</span><span class = Identifier>x</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>&lt;</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>&amp;</span><span class = Undefined>&amp;</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>y</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Keyword>if</span>&nbsp;<span class = Identifier>r</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>/</span><span class = Undefined>=</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span>&nbsp;<span class = Keyword>then</span>&nbsp;<span class = Identifier>r</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>+</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>#</span>&nbsp;<span class = Keyword>else</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Identifier>otherwise</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>r</span><span class = Undefined>#</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Keyword>where</span><br>&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>!</span><span class = Identifier>r</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>x</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>remInt</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>#</span><br><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = TypeIdentifier>Definitions</span>&nbsp;<span class = Keyword>of</span>&nbsp;<span class = Identifier>the</span>&nbsp;<span class = Identifier>boxed</span>&nbsp;<span class = TypeIdentifier>PrimOps</span><span class = Undefined>;</span>&nbsp;<span class = Identifier>these</span>&nbsp;<span class = Identifier>will</span>&nbsp;<span class = Identifier>be</span>&nbsp;<span class = Identifier>used</span>&nbsp;<span class = Keyword>in</span>&nbsp;<span class = Identifier>the</span>&nbsp;<span class = Keyword>case</span>&nbsp;<span class = Keyword>of</span>&nbsp;<span class = Identifier>partial</span>&nbsp;<span class = Identifier>applications</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>etc</span><span class = Undefined>.</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>begin</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span><br><span class = Comment>{-# INLINE plusInt #-}</span><br><span class = Comment>{-# INLINE minusInt #-}</span><br><span class = Comment>{-# INLINE timesInt #-}</span><br><span class = Comment>{-# INLINE quotInt #-}</span><br><span class = Comment>{-# INLINE remInt #-}</span><br><span class = Comment>{-# INLINE negateInt #-}</span><br><br><span class = Identifier>plusInt</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>minusInt</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>timesInt</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>quotInt</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>remInt</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>divInt</span><span class = Undefined>,</span>&nbsp;<span class = Identifier>modInt</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>Int</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span><br><span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>x</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>plusInt</span><span class = Undefined>`</span>&nbsp;&nbsp;<span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>x</span>&nbsp;<span class = Undefined>+</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>)</span><br><span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>x</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>minusInt</span><span class = Undefined>`</span>&nbsp;<span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>x</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>)</span><br><span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>x</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>timesInt</span><span class = Undefined>`</span>&nbsp;<span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>x</span>&nbsp;<span class = Undefined>*</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>)</span><br><span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>x</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>quotInt</span><span class = Undefined>`</span>&nbsp;&nbsp;<span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>x</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>quotInt</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>)</span><br><span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>x</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>remInt</span><span class = Undefined>`</span>&nbsp;&nbsp;&nbsp;<span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>x</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>remInt</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;&nbsp;<span class = Identifier>y</span><span class = Undefined>)</span><br><span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>x</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>divInt</span><span class = Undefined>`</span>&nbsp;&nbsp;&nbsp;<span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>x</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>divInt</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;&nbsp;<span class = Identifier>y</span><span class = Undefined>)</span><br><span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>x</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>modInt</span><span class = Undefined>`</span>&nbsp;&nbsp;&nbsp;<span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>y</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>x</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>modInt</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;&nbsp;<span class = Identifier>y</span><span class = Undefined>)</span><br><br><span class = Comment>{-# RULES</span><span class = Comment>"x# +# 0#" forall x#. x# +# 0# = x#</span><span class = Comment>"0# +# x#" forall x#. 0# +# x# = x#</span><span class = Comment>"x# -# 0#" forall x#. x# -# 0# = x#</span><span class = Comment>"x# -# x#" forall x#. x# -# x# = 0#</span><span class = Comment>"x# *# 0#" forall x#. x# *# 0# = 0#</span><span class = Comment>"0# *# x#" forall x#. 0# *# x# = 0#</span><span class = Comment>"x# *# 1#" forall x#. x# *# 1# = x#</span><span class = Comment>"1# *# x#" forall x#. 1# *# x# = x#</span><span class = Comment>  #-}</span><br><br><span class = Identifier>negateInt</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>Int</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span><br><span class = Identifier>negateInt</span>&nbsp;<span class = Undefined>(</span><span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>x</span><span class = Undefined>)</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = TypeIdentifier>I</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>(</span><span class = Identifier>negateInt</span><span class = Undefined>#</span>&nbsp;<span class = Identifier>x</span><span class = Undefined>)</span><br><br><span class = Comment>{-# RULES</span><span class = Comment>"x# &gt;# x#"  forall x#. x# &gt;#  x# = False</span><span class = Comment>"x# &gt;=# x#" forall x#. x# &gt;=# x# = True</span><span class = Comment>"x# ==# x#" forall x#. x# ==# x# = True</span><span class = Comment>"x# /=# x#" forall x#. x# /=# x# = False</span><span class = Comment>"x# &lt;# x#"  forall x#. x# &lt;#  x# = False</span><span class = Comment>"x# &lt;=# x#" forall x#. x# &lt;=# x# = True</span><span class = Comment>  #-}</span><br><br><span class = Comment>{-# RULES</span><span class = Comment>"plusFloat x 0.0"   forall x#. plusFloat#  x#   0.0# = x#</span><span class = Comment>"plusFloat 0.0 x"   forall x#. plusFloat#  0.0# x#   = x#</span><span class = Comment>"minusFloat x 0.0"  forall x#. minusFloat# x#   0.0# = x#</span><span class = Comment>"timesFloat x 1.0"  forall x#. timesFloat# x#   1.0# = x#</span><span class = Comment>"timesFloat 1.0 x"  forall x#. timesFloat# 1.0# x#   = x#</span><span class = Comment>"divideFloat x 1.0" forall x#. divideFloat# x#  1.0# = x#</span><span class = Comment>  #-}</span><br><br><span class = Comment>{-# RULES</span><span class = Comment>"plusDouble x 0.0"   forall x#. (+##) x#    0.0## = x#</span><span class = Comment>"plusDouble 0.0 x"   forall x#. (+##) 0.0## x#    = x#</span><span class = Comment>"minusDouble x 0.0"  forall x#. (-##) x#    0.0## = x#</span><span class = Comment>"timesDouble x 1.0"  forall x#. (*##) x#    1.0## = x#</span><span class = Comment>"timesDouble 1.0 x"  forall x#. (*##) 1.0## x#    = x#</span><span class = Comment>"divideDouble x 1.0" forall x#. (/##) x#    1.0## = x#</span><span class = Comment>  #-}</span><br><br><span class = Comment>{-</span><span class = Comment>We'd like to have more rules, but for example:</span><span class = Comment></span><span class = Comment>This gives wrong answer (0) for NaN - NaN (should be NaN):</span><span class = Comment>    "minusDouble x x"    forall x#. (-##) x#    x#    = 0.0##</span><span class = Comment></span><span class = Comment>This gives wrong answer (0) for 0 * NaN (should be NaN):</span><span class = Comment>    "timesDouble 0.0 x"  forall x#. (*##) 0.0## x#    = 0.0##</span><span class = Comment></span><span class = Comment>This gives wrong answer (0) for NaN * 0 (should be NaN):</span><span class = Comment>    "timesDouble x 0.0"  forall x#. (*##) x#    0.0## = 0.0##</span><span class = Comment></span><span class = Comment>These are tested by num014.</span><span class = Comment></span><span class = Comment>Similarly for Float (#5178):</span><span class = Comment></span><span class = Comment>"minusFloat x x"    forall x#. minusFloat# x#   x#   = 0.0#</span><span class = Comment>"timesFloat0.0 x"   forall x#. timesFloat# 0.0# x#   = 0.0#</span><span class = Comment>"timesFloat x 0.0"  forall x#. timesFloat# x#   0.0# = 0.0#</span><span class = Comment>-}</span><br><br><span class = Comment>-- Wrappers for the shift operations.  The uncheckedShift# family are</span><span class = Comment>-- undefined when the amount being shifted by is greater than the size</span><span class = Comment>-- in bits of Int#, so these wrappers perform a check and return</span><span class = Comment>-- either zero or -1 appropriately.</span><span class = Comment>--</span><span class = Comment>-- Note that these wrappers still produce undefined results when the</span><span class = Comment>-- second argument (the shift amount) is negative.</span><br><span class = Comment>-- | Shift the argument left by the specified number of bits</span><span class = Comment>-- (which must be non-negative).</span><span class = Identifier>shiftL</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>Word</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Word</span><span class = Undefined>#</span><br><span class = Identifier>a</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>shiftL</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>b</span>&nbsp;&nbsp;&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>=</span><span class = Undefined>#</span>&nbsp;<span class = TypeIdentifier>WORD</span><span class = Undefined>_</span><span class = TypeIdentifier>SIZE</span><span class = Undefined>_</span><span class = TypeIdentifier>IN</span><span class = Undefined>_</span><span class = TypeIdentifier>BITS</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>int2Word</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Identifier>otherwise</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>uncheckedShiftL</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>b</span><br><br><span class = Comment>-- | Shift the argument right by the specified number of bits</span><span class = Comment>-- (which must be non-negative).</span><span class = Identifier>shiftRL</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>Word</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Word</span><span class = Undefined>#</span><br><span class = Identifier>a</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>shiftRL</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>b</span>&nbsp;&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>=</span><span class = Undefined>#</span>&nbsp;<span class = TypeIdentifier>WORD</span><span class = Undefined>_</span><span class = TypeIdentifier>SIZE</span><span class = Undefined>_</span><span class = TypeIdentifier>IN</span><span class = Undefined>_</span><span class = TypeIdentifier>BITS</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>int2Word</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Identifier>otherwise</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>uncheckedShiftRL</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>b</span><br><br><span class = Comment>-- | Shift the argument left by the specified number of bits</span><span class = Comment>-- (which must be non-negative).</span><span class = Identifier>iShiftL</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span><br><span class = Identifier>a</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>iShiftL</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>b</span>&nbsp;&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>=</span><span class = Undefined>#</span>&nbsp;<span class = TypeIdentifier>WORD</span><span class = Undefined>_</span><span class = TypeIdentifier>SIZE</span><span class = Undefined>_</span><span class = TypeIdentifier>IN</span><span class = Undefined>_</span><span class = TypeIdentifier>BITS</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Identifier>otherwise</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>uncheckedIShiftL</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>b</span><br><br><span class = Comment>-- | Shift the argument right (signed) by the specified number of bits</span><span class = Comment>-- (which must be non-negative).</span><span class = Identifier>iShiftRA</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span><br><span class = Identifier>a</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>iShiftRA</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>=</span><span class = Undefined>#</span>&nbsp;<span class = TypeIdentifier>WORD</span><span class = Undefined>_</span><span class = TypeIdentifier>SIZE</span><span class = Undefined>_</span><span class = TypeIdentifier>IN</span><span class = Undefined>_</span><span class = TypeIdentifier>BITS</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Keyword>if</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>&lt;</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span>&nbsp;<span class = Keyword>then</span>&nbsp;<span class = Undefined>(</span><span class = Undefined>-</span><span class = Undefined>1</span><span class = Undefined>#</span><span class = Undefined>)</span>&nbsp;<span class = Keyword>else</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Identifier>otherwise</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>uncheckedIShiftRA</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>b</span><br><br><span class = Comment>-- | Shift the argument right (unsigned) by the specified number of bits</span><span class = Comment>-- (which must be non-negative).</span><span class = Identifier>iShiftRL</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>:</span><span class = Undefined>:</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>-</span><span class = Undefined>&gt;</span>&nbsp;<span class = TypeIdentifier>Int</span><span class = Undefined>#</span><br><span class = Identifier>a</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>iShiftRL</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Identifier>b</span>&nbsp;<span class = Undefined>&gt;</span><span class = Undefined>=</span><span class = Undefined>#</span>&nbsp;<span class = TypeIdentifier>WORD</span><span class = Undefined>_</span><span class = TypeIdentifier>SIZE</span><span class = Undefined>_</span><span class = TypeIdentifier>IN</span><span class = Undefined>_</span><span class = TypeIdentifier>BITS</span><span class = Undefined>#</span>&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Undefined>0</span><span class = Undefined>#</span><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>|</span>&nbsp;<span class = Identifier>otherwise</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class = Undefined>=</span>&nbsp;<span class = Identifier>a</span>&nbsp;<span class = Undefined>`</span><span class = Identifier>uncheckedIShiftRL</span><span class = Undefined>#</span><span class = Undefined>`</span>&nbsp;<span class = Identifier>b</span><br><br><span class = Undefined>#</span><span class = Keyword>if</span>&nbsp;<span class = TypeIdentifier>WORD</span><span class = Undefined>_</span><span class = TypeIdentifier>SIZE</span><span class = Undefined>_</span><span class = TypeIdentifier>IN</span><span class = Undefined>_</span><span class = TypeIdentifier>BITS</span>&nbsp;<span class = Undefined>=</span><span class = Undefined>=</span>&nbsp;<span class = Undefined>3</span><span class = Undefined>2</span><br><span class = Comment>{-# RULES</span><span class = Comment>"narrow32Int#"  forall x#. narrow32Int#   x# = x#</span><span class = Comment>"narrow32Word#" forall x#. narrow32Word#   x# = x#</span><span class = Comment>   #-}</span><br><span class = Undefined>#</span><span class = Identifier>endif</span><br><br><span class = Comment>{-# RULES</span><span class = Comment>"int2Word2Int"  forall x#. int2Word# (word2Int# x#) = x#</span><span class = Comment>"word2Int2Word" forall x#. word2Int# (int2Word# x#) = x#</span><span class = Comment>  #-}</span><br><br><br><span class = Comment>-- Rules for C strings (the functions themselves are now in GHC.CString)</span><span class = Comment>{-# RULES</span><span class = Comment>"unpack"       [~1] forall a   . unpackCString# a             = build (unpackFoldrCString# a)</span><span class = Comment>"unpack-list"  [1]  forall a   . unpackFoldrCString# a (:) [] = unpackCString# a</span><span class = Comment>"unpack-append"     forall a n . unpackFoldrCString# a (:) n  = unpackAppendCString# a n</span><span class = Comment></span><span class = Comment>-- There's a built-in rule (in PrelRules.lhs) for</span><span class = Comment>--      unpackFoldr "foo" c (unpackFoldr "baz" c n)  =  unpackFoldr "foobaz" c n</span><span class = Comment></span><span class = Comment>  #-}</span><br><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>#</span><span class = Identifier>ifdef</span>&nbsp;<span class = Undefined>_</span><span class = Undefined>_</span><span class = TypeIdentifier>HADDOCK</span><span class = Undefined>_</span><span class = Undefined>_</span>&nbsp;<span class = Undefined>\</span><span class = Identifier>begin</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span><br><span class = Comment>-- | A special argument for the 'Control.Monad.ST.ST' type constructor,</span><span class = Comment>-- indexing a state embedded in the 'Prelude.IO' monad by</span><span class = Comment>-- 'Control.Monad.ST.stToIO'.</span><span class = Undefined>\</span><span class = Identifier>end</span><span class = Undefined>{</span><span class = Identifier>code</span><span class = Undefined>}</span>&nbsp;<span class = Undefined>#</span><span class = Identifier>endif</span><br></pre></pre></body>